home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_100 / 148_01 / xasm99.doc < prev    next >
Text File  |  1987-09-26  |  39KB  |  1,022 lines

  1. .pl 70
  2. .op
  3.  
  4. .he        TMS9900/99105 Cross-assembler  Rev. 1.0                    Page #
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.                   TMS9900/99105 Cross-assembler
  13.  
  14.  
  15.                             Rev. 1.0
  16.  
  17.         Derived from the original William C. Colley, III.
  18.                       M6800 Cross Assembler
  19.  
  20.                                by
  21.  
  22.  
  23.                         Alexander Cameron 
  24.  
  25.              Written and modified during June 1984.
  26.  
  27.  
  28.  
  29.  
  30.                     The Manual Such As It Is.
  31.  
  32.  
  33. .pa
  34. .pn 1
  35. .op
  36. ...COLUMNWIDTH 65
  37. ...MARGINWIDTH 6
  38. ...T1
  39.         1.1       Format of Cross-assembler Commands
  40. ...T2
  41.         1.1.1     Command Strings
  42.  
  43.                   To   run  the 9900 cross-assembler,   type  the 
  44.                   following command line:
  45.  
  46.                   A>a99 filename options
  47.  
  48.                   filename: 
  49.                   The   name   of  the  source  input   file   is 
  50.                   filename.a99,  the list can go to filename.l99, 
  51.                   and the hex file can go to filename.h99.
  52.  
  53.                   options:   See next section.
  54.  
  55. ...T2                 
  56.         1.1.2     Options
  57.  
  58.                   The   source  file  comes  from  the  currently  
  59.                   logged  disk drive  unless  it is redirected by 
  60.                   putting  the  string "sd" in the options field.  
  61.                   s  specifies the source file and d is a  device 
  62.                   code from the following list:
  63.  
  64.                   a, b, c, d   Disk drives.
  65.                   -            The currently logged in disk drive.
  66.  
  67.                   Lines   of input containing errors will  always 
  68.                   be  output to the console device.   If the full 
  69.                   listing  is desired,  it must be called for  by 
  70.                   putting  the string "ld" in the options  field.  
  71.                   l specifies list file and d is a device code as 
  72.                   per the source file,  or one of the  following: 
  73.                  
  74.                   x              Console device.
  75.                   y              List device.
  76.  
  77.                   The   hex file will not be output unless called  
  78.                   for  as per the list file.
  79.  
  80.                   Options   must  be run together into  a  single 
  81.                   string with no embedded blanks.
  82.  
  83. ...T2
  84.         1.1.3     Examples
  85.  
  86.                   A>a99 barf       source -- a:barf.a99
  87.                                       list   -- none.
  88.                                       hex    -- none.
  89.  
  90.                   A>a99 barf sblxha source -- b:barf.a99
  91.                                       list   -- con:
  92.                                       hex    -- a:barf.h99
  93.  
  94.                   A>a99 barf ly    source -- a:barf.a99
  95.                                       list   -- lst:
  96.                                       hex    -- none.
  97.  
  98.  
  99.                   A>b:a99 barf sbh-  source -- b:barf.a99
  100.                                       list   -- none.
  101.                                       hex    -- a:barf.h99
  102.  
  103.  
  104. ...T1
  105.         1.2       Format of TMS9900 Cross-assembler Source Files
  106.  
  107.                   Lines of source input are terminated with CR/LF  
  108.                   pairs.  Internally, the character before the LF 
  109.                   is discarded, so if the CR is missing, the last 
  110.                   character  of the line will be eaten  up.   The 
  111.                   internal line buffer will hold a 120  character 
  112.                   line.    This  may be changed by  altering  the  
  113.                   "#define  LINLEN  120" statement in  xasm99.gbl 
  114.                   and  recompiling the cross-assembler.    Excess 
  115.                   characters in the line are thrown out.
  116.  
  117.                   Lower   case   letters are converted  to  upper 
  118.                   case in  as few places as possible.  They are:
  119.  
  120.                        1)  In opcodes,
  121.  
  122.                        2)  In checking for keywords such as NOT, and
  123.  
  124.                        3)  In command strings.
  125.  
  126.                   This  means that "not",   "NOT",   "Not",  etc.  
  127.                   are   all  possible  spellings of  the  logical 
  128.                   inversion   operator.  This  also   means  that 
  129.                   "foo"   and   "FOO"   are   different  symbols.  
  130.                   Watch  this if you start encountering U  errors 
  131.                   of symbols that you "know" you defined.
  132.  
  133. ...T2
  134.         1.2.1     Statements
  135.  
  136.                   Source files input to the 9900  Cross-assembler  
  137.                   consist of statements of the form:
  138.  
  139.                   [label] [opcode] [arguments] [;comments.]
  140.  
  141.                   Labels   are  recognized by their beginning  in 
  142.                   column  1. If  it  doesn't  begin there,  it is 
  143.                   assumed  to   be   an  opcode.     Labels   are  
  144.                   assigned  the  current  program counter   value  
  145.                   unless  the line's opcode is  "EQU"  or "SET".
  146.  
  147.                   Opcodes    may   be  either  9900   instruction  
  148.                   mnemonics  or pseudo-ops.
  149.  
  150.                   The   arguments following the opcode will  vary 
  151.                   with  the opcode.   In the case of opcodes such 
  152.                   as "NOP", they may be absent entirely.
  153.  
  154.                   Lines  terminate with either a CR/LF pair or  a 
  155.                   semicolon  that  is  not embedded in a   quoted  
  156.                   string.   Anything after a semicolon is ignored 
  157.                   by  the  assembler,  but  will  appear  in  the 
  158.                   listing.   Note  that  a semicolon in column  1 
  159.                   will make the entire line a comment.
  160. ...T2
  161.         1.2.2     Symbols
  162.  
  163.                   Symbols  may  be of any length,   but only  the  
  164.                   first   8 characters  are  significant.    This 
  165.                   may  be  changed   by  changing   the  "#define 
  166.                   SYMLEN   8"   statement    in    a68.gbl    and   
  167.                   recompiling   the   assembler.      Note   that   
  168.                   this  increases   the storage required  by  the 
  169.                   symbol  table   as each  entry  in  the  symbol 
  170.                   table  is  SYMLEN+2  bytes   in  length.    The  
  171.                   following    characters   are   legal   in    a 
  172.                   symbol:
  173.  
  174.                        A-Z  a-z  !  &  .  :  ?  [  \  ]  ^  _  `
  175.                                  {  |  }  ~  0-9
  176.  
  177.                   Note   that  symbols may not begin with 0-9  as 
  178.                   this would make  them impossible to distinguish 
  179.                   from Intel  format numbers.
  180.  
  181.                   A   special   symbol $ is always equal  to  the 
  182.                   address  of the first byte of code generated by 
  183.                   a given line.
  184.  
  185. ...T2
  186.         1.2.3     Numeric Constants
  187.  
  188.                   Numbers  begin  with  0-9,%.  %  leading   base  
  189.                   designator  represent  binary.  If  the  number 
  190.                   begins with 0-9,  the  assembler  looks for one 
  191.                   of the trailing  base designators B,  O,  Q, D, 
  192.                   or  H.   If the number does not end with one of 
  193.                   these,  it is assumed to be decimal.  B is  the  
  194.                   base designator for binary,   O and Q  are  for 
  195.                   octal,   D   is  for decimal,   and H  is   for  
  196.                   hexidecimal.  Trailing base designators and the 
  197.                   hex digits A-F can be in  either upper or lower 
  198.                   case.    Note  that  hex numbers  that    start  
  199.                   with   A-F   and   are   specified   with   the 
  200.                   designator   H  must have a leading zero  added  
  201.                   to  keep them from being mistaken for  symbols.  
  202.                   For example:
  203.  
  204.                   0ff80h            evaluate to ff80 hex.
  205.                   128 and 128d             evaluate to 80 hex.
  206.                   35o, and 35q             evaluate to 1d hex.
  207.                   %0111000 and 0111000b    evaluate to 39 hex.
  208.  
  209.